package com.ruoyi.user.service.impl;

import java.util.List;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.user.mapper.UserConversationRecordMapper;
import com.ruoyi.user.domain.UserConversationRecord;
import com.ruoyi.user.service.IUserConversationRecordService;

/**
 * 用户会话记录Service业务层处理
 * 
 * @author DEREK
 * @date 2024-01-15
 */
@Service
public class UserConversationRecordServiceImpl extends ServiceImpl<UserConversationRecordMapper, UserConversationRecord> implements IUserConversationRecordService 
{
    @Autowired
    private UserConversationRecordMapper userConversationRecordMapper;

    /**
     * 查询用户会话记录
     * 
     * @param id 用户会话记录主键
     * @return 用户会话记录
     */
    @Override
    public UserConversationRecord selectUserConversationRecordById(Long id)
    {
        return userConversationRecordMapper.selectUserConversationRecordById(id);
    }

    /**
     * 查询用户会话记录列表
     * 
     * @param userConversationRecord 用户会话记录
     * @return 用户会话记录
     */
    @Override
    public List<UserConversationRecord> selectUserConversationRecordList(UserConversationRecord userConversationRecord)
    {
        return userConversationRecordMapper.selectUserConversationRecordList(userConversationRecord);
    }

    /**
     * 新增用户会话记录
     * 
     * @param userConversationRecord 用户会话记录
     * @return 结果
     */
    @Override
    public int insertUserConversationRecord(UserConversationRecord userConversationRecord)
    {
        userConversationRecord.setCreateTime(DateUtils.getNowDate());
        return userConversationRecordMapper.insertUserConversationRecord(userConversationRecord);
    }

    /**
     * 修改用户会话记录
     * 
     * @param userConversationRecord 用户会话记录
     * @return 结果
     */
    @Override
    public int updateUserConversationRecord(UserConversationRecord userConversationRecord)
    {
        return userConversationRecordMapper.updateUserConversationRecord(userConversationRecord);
    }

    /**
     * 批量删除用户会话记录
     * 
     * @param ids 需要删除的用户会话记录主键
     * @return 结果
     */
    @Override
    public int deleteUserConversationRecordByIds(Long[] ids)
    {
        return userConversationRecordMapper.deleteUserConversationRecordByIds(ids);
    }

    /**
     * 删除用户会话记录信息
     * 
     * @param id 用户会话记录主键
     * @return 结果
     */
    @Override
    public int deleteUserConversationRecordById(Long id)
    {
        return userConversationRecordMapper.deleteUserConversationRecordById(id);
    }
}
